import 'package:flutter/material.dart';
import 'package:module_home/const/string.dart';

class ISSTop extends StatelessWidget {
  final String title;
  final String img;

  const ISSTop({Key key, this.title, this.img}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          alignment: Alignment.center,
          height: 120,
          child: ConstrainedBox(
            child: Image.asset(
              "images/compute_header_bg2.png",
              fit: BoxFit.cover,
            ),
            constraints: new BoxConstraints.expand(),
          ),
        ),
        Container(
          alignment: Alignment.center,
          height: 100,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Visibility(
                  visible: img.length != 0,
                  child: Padding(
                      padding: EdgeInsets.only(bottom: 5),
                      child: Image.asset(
                        img,
                        width: 40,
                        height: 40,
                      ))),
              Text(
                title,
                textAlign: TextAlign.center,
                style: TextStyle(
                    color: Colors.white,
                    fontSize: 18,
                    fontWeight: FontWeight.bold),
              ),
              Padding(
                  padding: EdgeInsets.only(top: 5),
                  child: Text(
                    iss_description,
                    textAlign: TextAlign.center,
                    style: TextStyle(color: Colors.white, fontSize: 12),
                  ))
            ],
          ),
        ),
      ],
    );
  }
}
